package com.adv.web.service;

import org.apache.cxf.endpoint.Client;
import org.apache.cxf.jaxws.endpoint.dynamic.JaxWsDynamicClientFactory;

public class WsUtil {
	public static final String METHODENAME="advhandPubService";
	
	public static String sendWebService(String action,String param){  
		  Object[] objects = null;
		  String result = "";
		  String url = "http://114.251.235.32:57772/dthealth/web/web.DHCADVWebService.CLS?WSDL=1";  
		  JaxWsDynamicClientFactory factory = JaxWsDynamicClientFactory.newInstance();  
		  Client client = factory.createClient(url);
		 
		  try {
			objects =client.invoke(METHODENAME, new Object[]{action,param});
		} catch (Exception e) {
			e.printStackTrace();
		}
		  result = objects[0].toString();
		  return result;
	}
}
